//------------------------------------------------------------------------------
//  Mesh.cpp
//  (C) 2009 xoyojank
//------------------------------------------------------------------------------
#include "StdEddy.h"
#include "Graphics/Mesh.h"
#include "Graphics/RenderDevice.h"

namespace Eddy
{

//------------------------------------------------------------------------------
void
Mesh::ApplyPrimitiveGroup(IndexT index)
{
    assert(index < this->primitives.size());

    RenderDevice* renderDevice = RenderDevice::Instance();
    renderDevice->SetVertexBuffer(this->vertexBuffer);
    renderDevice->SetIndexBuffer(this->indexBuffer);
    renderDevice->SetPrimitiveGroup(this->primitives[index]);
}

}// namespace Eddy
